package com.awcall.iot.service.impl;

import com.awcall.iot.model.Setting;
import com.awcall.iot.mapper.SettingMapper;
import com.awcall.iot.service.ISettingService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wuhui
 * @since 2018-03-22
 */
@Service
public class SettingServiceImpl extends ServiceImpl<SettingMapper, Setting> implements ISettingService {

    @Override
    public String getValue(String key) {

        EntityWrapper<Setting> entityWrapper = new EntityWrapper<>();
        entityWrapper.eq(Setting.KEY,key);
        Setting setting = selectOne(entityWrapper);
        return setting.getName();
    }
}
